<template>
  <el-container>
    <!-- 标头 -->
    <el-header>
      <el-row>
        <el-col :span="3">
          <div class="grid-content bg-purple"><h1>可莉的</h1></div>
        </el-col>

        <el-col :span="13">
          <div class="grid-content bg-purple-light">&nbsp;&nbsp;</div>
        </el-col>

        <el-col :span="2">
          <div class="grid-content bg-purple">
            <el-avatar src=""></el-avatar>
          </div>
        </el-col>

        <el-col :span="4">
          <div class="grid-content bg-purple-light">{{uname}}</div>
        </el-col>

        <el-col :span="2">
          <div class="grid-content bg-purple-light" @click="tuicu" style="cursor: pointer">退出▼</div>
        </el-col>
      </el-row>
    </el-header>

    <!-- 导航 -->
    <el-container>
      <!-- 左边 -->
      <el-aside width="167px">
        <el-row class="tac">
          <el-col :span="12">
            <el-menu
              default-active="2"
              class="el-menu-vertical-demo"
              @open="handleOpen"
              @close="handleClose"
            >
              <el-menu-item index="1">
                <i class="el-icon-s-home"></i>
                <span slot="title">可莉的</span>
              </el-menu-item>

              <el-submenu index="2">
                <template slot="title">
                  <i class="el-icon-s-order"></i>
                  <span>工单管理</span>
                </template>
                <el-menu-item index="2-1">运营工单</el-menu-item>
                <el-menu-item index="2-2">运维工单</el-menu-item>
              </el-submenu>

              <el-submenu index="3">
                <template slot="title">
                  <i class="el-icon-location-information"></i>
                  <span>点位管理</span>
                </template>
                <el-menu-item index="3-1">区域管理</el-menu-item>
                <el-menu-item index="3-2">点位管理</el-menu-item>
                <el-menu-item index="3-3">合作商管理</el-menu-item>
              </el-submenu>

              <el-submenu index="4">
                <template slot="title">
                  <i class="el-icon-s-platform"></i>
                  <span>设备管理</span>
                </template>
                <el-menu-item index="4-1">设备管理</el-menu-item>
                <el-menu-item index="4-2">设备状态</el-menu-item>
                <el-menu-item index="4-3">设备类型管理</el-menu-item>
              </el-submenu>

              <el-submenu index="5">
                <template slot="title">
                  <i class="el-icon-s-tools"></i>
                  <span>人员管理</span>
                </template>
                <el-menu-item index="5-1">人员列表</el-menu-item>
                <el-menu-item index="5-2">人效统计</el-menu-item>
                <el-menu-item index="5-3">工作量列表</el-menu-item>
              </el-submenu>

              <el-submenu index="6">
                <template slot="title">
                  <i class="el-icon-shopping-bag-2"></i>
                  <span>商品管理</span>
                </template>
                <el-menu-item index="6-1">商品类型</el-menu-item>
                <el-menu-item index="6-2">商品管理</el-menu-item>
              </el-submenu>

              <el-menu-item index="7">
                <i class="el-icon-s-opportunity"></i>
                <span slot="title">策略管理</span>
              </el-menu-item>

              <el-menu-item index="8">
                <i class="el-icon-office-building"></i>
                <span slot="title">订单管理</span>
              </el-menu-item>

              <el-menu-item index="9">
                <i class="el-icon-s-claim"></i>
                <span slot="title">对账统计</span>
              </el-menu-item>
            </el-menu>
          </el-col>
        </el-row>
      </el-aside>
      <!-- 右边 -->
      <el-main>Main</el-main>
    </el-container>
  </el-container>
</template>

<script>
export default {
  data() {
    return {
      // 用户名
      uname: '旅行者'
    }
  },
  methods: {
  // 导航里的
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    // 退出
    tuicu(){
      // 删除token
      // this.$store.commit...
      // 跳转
      // this.$router.push('/denglu')
    }
  },
};
</script>

<style lang="less" scoped>
.el-avatar{
  position: relative;
  // left: 10px;
  top: 10px;
}
.el-header,
.el-footer {
  background-color: #fa3b45;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #fff;
  color: #333;
  text-align: center;
  line-height: 200px;
}

.el-main {
  background-color: #f8fafd;
  color: #333;
  text-align: center;
  line-height: 160px;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
::v-deep .el-submenu__title {
  width: 167px;
}
::v-deep .el-submenu .el-menu-item {
  min-width: 167px;
}
::v-deep .el-aside {
  overflow-x: hidden;
  overflow-y: hidden;
}
::v-deep .el-col-12 {
  width: 100%;
}
</style>
